# 3.4名单
gusts = ['tom' , 'bob' , 'ming']
for gust in gusts:
    print(f"{gust}，would you like dinner for me?")

# 3.5修改名单
not_come = "tom"
print(f"{not_come} cann't come dinner")
new_gust = "hong"
gusts[0] = new_gust
for gust in gusts:
    print(f"{gust}，would you like dinner for me?")

# 3.6添加嘉宾
print("i find a big desk,we can together more people!")
gusts.insert(0,'hao')
gusts.insert(2,'kaka')
gusts.append('lili')
print(gusts)
for gust in gusts:
    print(f"{gust}，would you like dinner for me?")

# 3.7缩短名单
print("i want to invite two people")
while len(gusts) > 2:
    pass_gust = gusts.pop()
    print(f"{pass_gust},i am sorry to tell you we cann't together dinner")

print(gusts)
for gust in gusts:
    print(f"{gust}，would you like dinner for me?")
    
del gusts[0]
del gusts[1]
print(gusts)